package com.ludomancy.hugealien;


import com.ludomancy.gamelib.GameApplet;
import com.ludomancy.gamelib.Sound;
import com.ludomancy.gamelib.Soundtrack;
import com.ludomancy.gamelib.Theme;

public class HugeAlienApp extends GameApplet
{
	public static MainWidget mainWidget;
	public static HugeAlienApp app;
	private GameTheme theme;
	private Soundtrack music;
	
	public void onInit()
	{
		app = this;
		fps = 35;
		theme = new GameTheme();
		gameCanvas.setCursor(false);
		Sound.soundActivated = true;		
		music = new Soundtrack(new String[]{"crickets.ogg", "crickets.ogg", "crickets.ogg", "music.ogg","music.ogg"});
//		music = new Soundtrack(new String[]{"music.ogg","music.ogg"});
		music.loop();
		resetGame();
	}
	
	protected void onDestroy()
	{
	}

	protected void onDisplay(boolean active)
	{
		Game.game.setPaused(!active);
	}
	
	public void resetGame()
	{
		// create the game
		new Game();
		// create the UI
		if(mainWidget != null)
		{
			mainWidget.close();
		}
		mainWidget = new MainWidget(null, getBounds());
		gameCanvas.showWidget(mainWidget);
	}

	public Theme getDefaultTheme()
	{
		return theme;
	}
}
